import 'package:base_flutter/base_flutter.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';

import '../../../net/response/food/scan_old_data.dart';
import '../../../res/colors.dart';
import '../../../viewmodel/food/new_week/new_choose_week_menu_view_model.dart';

class NewChooseWeekMenuPage extends BaseStatefulMvvmWidget{
  final String time;
  final String siteId;
  final String orderModelType;
  final ScanOldData? oldData;
  final PickerDataWithIdModel? useType;

  NewChooseWeekMenuPage(
      {required this.time,
        required this.siteId,
        required this.orderModelType,
        this.oldData,this.useType});
  @override
  State<StatefulWidget> createState() => _NewChooseWeekMenuState();

}

class _NewChooseWeekMenuState extends BaseMvvmState<NewChooseWeekMenuViewModel,NewChooseWeekMenuPage>{
  @override
  Widget buildLoadingContentView() {
    return viewModel.menuContent();
  }

  @override
  Widget buildRootView(BuildContext context, Widget loadingContentWidget) {
    return Scaffold(
      backgroundColor: Colours.bg_color,
      appBar: AppBar(
        title: Text('${widget.oldData?.elderHumanName??""}  周点餐'),
      ),
      body: loadingContentWidget,

    );
  }

  @override
  NewChooseWeekMenuViewModel createViewModel() {
    return NewChooseWeekMenuViewModel(context,siteId: widget.siteId,
        time: widget.time,
        orderModelType: widget.orderModelType,
        oldData:widget.oldData,useType: widget.useType?.pickId);
  }

  @override
  void onRetryClick() {
    // TODO: implement onRetryClick
  }

}